package com.wish.wishhouse_resource.entity;

public enum BusinessStatus {
    VIA("审核通过", 1), NOTTHROUGH("审核不通过", 2), UNDERREVIEW("待审核", 3),MISSINFO("未完善企业信息", 4);
    // 成员变量
    private String name;
    private int index;
    // 构造方法
    private BusinessStatus(String name, int index) {
        this.name = name;
        this.index = index;
    }
    // 普通方法
    public static String getName(int index) {
        for (BusinessStatus c : BusinessStatus.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }
    // 普通方法
    public static int getIndex(String name) {
        for (BusinessStatus c : BusinessStatus.values()) {
            if (c.getName().equals(name) ) {
                return c.index;
            }
        }
        return 0;
    }
    // get set 方法
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getIndex() {
        return index;
    }
    public void setIndex(int index) {
        this.index = index;
    }
}